
import {defineStore} from "pinia";
import {reactive,ref} from "vue";

export const useBooksStore = defineStore("books",()=>{
    const books = reactive([
        {
            id:"01001",
            name:"三国演义"
        }
    ]);

    function addBook(book:any){
        books.push(book);  
    };

    const age = ref(5);
    function addAge(){
        age.value++;
    }

    return {
        books,
        addBook,
        age,
        addAge
    }

});